package meterMonitor.util;

import java.util.HashMap;
import java.util.Map;

/**
 * TODO: 状态返回转换工具类
 * @version 1.0.0
 **/
public class ShowUtil {

    /**
     * 0：未处理
     * 1：已处理
     * 2：处理中
     */
    private static final Map<Integer,String> deal_state =new HashMap(){
        {
            put(0, "未处理");
            put(1, "已处理");
            put(2, "处理中");
        }
    };
    public static String getDealState(int type,int code){
        String unit =type==1?deal_state.get(code):null;
        if(unit==null)
        {
            return "已处理";
        }
        return unit;
    }

    /**
     * 1, "数据超标"
     * 2, "PLC离线"
     */
    private static final Map<Integer,String> al_class =new HashMap(){
        {
            put(1, "数据超标");
            put(2, "PLC离线");
        }
    };


    public static String getAlClass(int type,int code){
        String unit =type==1?al_class.get(code):null;
        if(unit==null)
        {
            return "数据超标";
        }
        return unit;
    }
}
